localStorage.setItem("shop_id", "8");
localStorage.setItem("member_id", "0");
//获取header
function login_ajax() {
	var dat;
	MEMBER = localStorage.getItem("MEMBER-ENCODE");
	SHOP = localStorage.getItem("SHOP-ENCODE");
	if(!MEMBER || !SHOP) {
		$.ajax({
			"type": "post",
			"dataType": "json",
			"timeout": 7000,
			"async": false,
			"data": {
				"shop_id": localStorage.getItem("shop_id"),
				"member_id": localStorage.getItem("member_id")
			},
			"url": "http://api.foodie.vc/yhohuat.php?ver=1&mo=u&l=zh&a=put_member_login",
			"headers": {
				"MEMBER-ENCODE": "",
				"SHOP-ENCODE": ""
			},
			"success": function(data) {
				dat = data;
			},
			"error": function(e) {
				console.log("login_ajax错误");
			}
		})
		localStorage.setItem("MEMBER-ENCODE", dat.result.yingsoft_home_encode);
		localStorage.setItem("SHOP-ENCODE", dat.result.yingsoft_home_shop_encode);
		MEMBER = localStorage.getItem("MEMBER-ENCODE");
		SHOP = localStorage.getItem("SHOP-ENCODE");
	}
}
//取得数据
function common_ajax(key,data,lg) {
	var dat;
	$.ajax({
		"type": "post",
		"dataType": "json",
		"timeout": 7000,
		"async": false,
		"data": data,
		"url": "http://api.foodie.vc/yhohuat.php?ver=1&mo=u&l="+lg+"&a=" + key,
		"headers": {
			"MEMBER-ENCODE": MEMBER,
			"SHOP-ENCODE": SHOP
		},
		"success": function(d) {
			dat = d;
		},
		"error": function(e) {
			console.log("common_ajax错误");
		}
	})
	return dat;
}
